## build
FROM golang:1.17-alpine AS build

RUN mkdir /app
COPY . /app
WORKDIR /app
RUN go mod tidy && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /bin/http_service

## deploy
FROM alpine AS production

COPY --from=build /bin/http_service /bin/http_service
EXPOSE 8080
CMD ["/bin/http_service"]

